<!--
 * @FilePath     : /study_code/layui/10-6.html
 * @Description  : 水平对齐方式
 * @Date         : 2025-02-17 10:40
 * @Author       : Fang YingGui
 * @LastEditors  : fangyinggui 18715384437@163.com
 * @LastEditTime : 2025-04-09 10:46:05
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
    <link rel="stylesheet" href="/layui/dist/css/layui.css" />
  </head>
  <body>
    <div class="layui-btn-container">
      <button class="layui-btn layui-btn-primary demo-dropdown-align" lay-options="{}">
        左对齐
        <i class="layui-icon layui-icon-down layui-font-12"></i>
      </button>
      <button
        class="layui-btn layui-btn-primary demo-dropdown-align"
        lay-options="{align: 'center'}"
      >
        居中对齐
        <i class="layui-icon layui-icon-down layui-font-12"></i>
      </button>
      <button
        class="layui-btn layui-btn-primary demo-dropdown-align"
        lay-options="{align: 'right'}"
      >
        右对齐
        <i class="layui-icon layui-icon-down layui-font-12"></i>
      </button>
    </div>

    <script src="/layui/dist/layui.js"></script>
    <!-- <script src="/dropdown/common.js"></script> -->
    <script>
      layui.use(function () {
        var dropdown = layui.dropdown
        // 水平对齐方式
        dropdown.render({
          elem: '.demo-dropdown-align',
          // align: 'center' // align 已配置在元素 `lay-options` 属性上
          data: [
            {
              title: 'menu item test 111',
              id: 100,
            },
            {
              title: 'menu item test 222',
              id: 101,
            },
            {
              title: 'menu item test 333',
              id: 102,
            },
          ],
        })
      })
    </script>
  </body>
</html>
